package com.yuexun.dhdoctor.module.my.model.impl;

import com.yuexun.dhdoctor.module.my.api.MessageApi;
import com.yuexun.dhdoctor.module.my.bean.MessageInfoBean;
import com.yuexun.dhdoctor.module.my.model.IMessageModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2016/11/23.
 */
public class MessageModel implements IMessageModel {
    private MessageApi api;


    public MessageApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(MessageApi.class);
        }
    }

    @Override
    public Observable<MessageInfoBean> getMessageList(Map<String, String> praise) {
        api = ApiInstance();
        return api.messageList(praise);
    }


}
